//
//  SingletonFriendRelationSocket.swift
//  flowerpot
//
//  Created by fyname on 15/12/31.
//  Copyright © 2015年 senhe. All rights reserved.
//

import Foundation
import Starscream


class SingletonFriendRelationSocket{
    
    let webSocket = WebSocket(url: NSURL(string: "ws://\(Common.localhost):8088/weijia-wim-web/friendrelation/getfriendrelation")!)
    
    class var sharedInstance : SingletonFriendRelationSocket {
        struct StaticFriend {
            static let instance:SingletonFriendRelationSocket = SingletonFriendRelationSocket()
        }
        if(!StaticFriend.instance.webSocket.isConnected){
            StaticFriend.instance.webSocket.connect()
        }
        return StaticFriend.instance
    }
    
}